<!--
 * @Date         : 2024-03-29 14:38:53
 * @LastEditTime : 2024-09-25 21:26:16
 * @description  : 
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" href="/favicon.ico" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="color-scheme" content="light" />
    <title></title>
  </head>
  <body>
    <div id="app"></div>
    <script type="module" src="/src/main.js"></script>
    <script>
      function disableDarkMode() {
        if (
          window.matchMedia &&
          window.matchMedia("(prefers-color-scheme: dark)").matches
        ) {
          // 系统支持深色模式，并且当前处于深色模式下
          // 通过设置为只有浅色主题的媒体查询来强制进入浅色模式
          const body = document.body;
          const originalBackground = body.style.backgroundColor;
          const originalColor = body.style.color;

          // 添加媒体查询来覆盖系统设置
          const override = document.createElement("style");
          override.textContent = `
        @media (prefers-color-scheme: dark) {
          body {
            background-color: ${originalBackground || "white"};
            color: ${originalColor || "black"};
          }
        }
      `;
          document.head.appendChild(override);
        }
      }
      // 页面加载完成后立即禁用深色模式
      window.onload = disableDarkMode;
    </script>
  </body>
</html>
